package com.xrui.mysqlparser;

import org.antlr.v4.runtime.CharStreams;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.tree.ParseTree;

public class ParserTest {
    public static void main(String args[]){
        String sql = "SELECT CUST_NAME FROM CUSTOMERS WHERE CUST_NAME LIKE 'Kash%'";

        MySqlLexer lexer = new MySqlLexer(CharStreams.fromString(sql));
        MySqlParser parser = new MySqlParser(new CommonTokenStream(lexer));
        ParseTree root = parser.dmlStatement();

        System.out.println(root.toStringTree(parser));
    }
}
